<div class="form">


    <?php
    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'category-form',
        'enableAjaxValidation' => false,
            ));
    ?>

    <p class="note">
        <?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
    </p>

    <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'name'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'name', array('maxlength' => 45,'class'=>'input-xlarge')); ?>
            <?php echo $form->error($model, 'name'); ?>
        </div><!-- row -->
    </div>
    <?php if (Category::model()->count()): ?>
        <?php
        $parents = Category::model()->findAll('parent=0 AND status=1');

        $cm = new CommonCategoryMethods();
        $data = $cm->makeDropDown($parents);
        ?>

        <div class="row">
             <div class="rowLabel"><?php echo $form->labelEx($model, 'parent'); ?> </div>
            <div class="rowControl"> <?php echo $form->dropDownList($model, 'parent', $data,array('class'=>'selectbox')); ?>
            <?php echo $form->error($model, 'parent'); ?>
        </div>	  </div>	

    <?php endif ?>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'status'); ?></div>
        <div class="rowControl"><?php echo $form->dropDownList($model, 'status', array("1" => "Active", "0" => "InActive"),array('class'=>'selectstatus')); ?>    
            <?php echo $form->error($model, 'status'); ?>
        </div><!-- row -->
    </div>


    <div class="row">
        <div class="rowLabel">&nbsp;</div>
        <?php
        echo GxHtml::submitButton(Yii::t('app', 'Save'),array('class'=>'btn btn btn-primary'));
        $this->endWidget();
        ?>
    </div>
</div>
<!-- form -->
